1. Field of the Invention
The present invention relates to a communication system that connects a plurality of communication devices by cascade connection.
2. Description of the Related Art
Many image forming apparatus that use electrophotography, for instance, employ a centralized control method by a main control portion. In this type of image forming apparatus, however, the concentration of control puts heavy load on a central processing unit (CPU) in the main control portion. The main control portion therefore needs as high performance a CPU as possible in order to prevent a drop in performance.
Some recent image forming apparatus deal with the heavy load by distributed control of image forming processing in which the control system is distributed so that the main control portion at the center of control cooperates with a plurality of sub-control portions provided in a load unit. In this case, a bundle of control communication wires needs to be led out to the plurality of sub-control portions at a great physical distance from the main control portion, which is increasing the cost of bundle of wires.
Therefore, a different type of distributed control is also practiced which divides a plurality of control portions constituting an image forming apparatus among sub-CPUs or application-specific integrated circuits (ASICs). In this type of distributed control, serial communication is often employed for data exchange between CPUs, between a CPU and an ASIC, or between ASICs. The data exchange uses communication packets in many cases.
With communication lines used for serial communication, too, if main CPUs and sub-CPUs (including ASICs. Hereinafter, the term “sub-CPU” includes “ASIC”) are associated simply on a one-to-one basis, as many more communication lines as the number of sub-CPUs are needed. As a solution, communication systems via cascade connection have been proposed which minimize the number of communication lines used by connecting a plurality of sub-CPUs by cascade connection and using an upstream sub-CPU to relay communication to a downstream sub-CPU.
For example, Japanese Patent Application Laid-open No. Hei 11-321027 discloses a communication system in which the relative address of a cascade connection destination device viewed from a device with a communication control device mounted thereto is determined and used for communication to and from the cascade connection destination device. In this communication system, a main CPU on the master side holds communication to and from a sub-CPU on the slave side. The main CPU also holds communication to and from a sub-CPU that is connected downstream the slave-side sub-CPU (a cascade connection destination sub-CPU viewed from the main CPU). This communication mode has an advantage in that the number and length of communication lines are minimized by sharing communication lines.
In a communication system disclosed in U.S. Pat. No. 6,834,321, a main CPU determines how many cascade levels are there till a sub-CPU at the tail end of sub-CPUs connected by cascade connection. Specifically, each sub-CPU adds “1” to an ID number within a communication packet (a number for identifying communication to that sub-CPU) and sequentially transfers the resultant ID number to its cascade connection destination. In the case where a sub-CPU at the end of the line has not received a response from a cascade connection destination for a given period of time or longer, this sub-CPU is determined as the tail end CPU. The sub-CPU then puts an ID indicating that this sub-CPU is at the tail end in the communication packet, and transmits data to the main CPU via the group of upstream sub-CPUs. The main CPU can thus grasp how many cascade levels are there to reach the tail end. From then on, the main CPU can know the cascade level of a sub-CPU with which the main CPU is to communicate.
However, conventional communication systems premised on cascade connection allow the intrusion of noise in a communication line or the like to distort data contained in a communication packet in some cases. The data distortion causes problems such as a failure to execute processing accurately.
For example, if noise is superimposed at a point where the relative address is specified in Japanese Patent Application Laid-open No. Hei 11-321027 and at a point where an ID is specified in U.S. Pat. No. 6,834,321, the superimposing of noise can cause misinterpretation of the relative address or the ID. As a result, a main CPU which is supposed to hold communication to a sub-CPU connected directly to the main CPU may erroneously have communication to another sub-CPU which is connected by cascade connection. In addition, the lack of the originally necessary communication can cause the overall system operation to abort.
A measure for ensuring communication quality against such noise is detecting an error in data contained in a communication packet. Attaching a cyclic redundancy check (CRC) code or a checksum at the last frame location of a communication packet can be given as an example. However, the following problems unique to communication via cascade connection remain even after attaching a CRC code or a checksum.
In the case where a sub-CPU that has received a communication packet transfers the communication packet to its cascade connection destination after buffering the entire communication packet in order to check data for an error, the transfer is delayed by an amount of time required for the buffering. If this processing is to be performed in each of sub-CPUs connected by cascade connection, the effective communication baud rate drops in proportion to the number of cascade connection levels.
A method of minimizing the drop in communication baud rate has also been proposed in which the transfer of a communication packet to a downstream sub-CPU is started during the reception of the communication packet from the main CPU by an upstream sub-CPU. In this case, however, the communication packet is transferred before the upstream sub-CPU checks the CRC code and, if necessary, recalculates the CRC code. The downstream sub-CPU therefore cannot conduct data error detection with an effective CRC code.